package com.bawei.yangzongcai___day2.APP;

import android.app.Application;

import com.alibaba.android.arouter.launcher.ARouter;
import com.squareup.leakcanary.LeakCanary;
import com.uuzuche.lib_zxing.activity.ZXingLibrary;

/**
 * create by ertu
 * create on 2021/7/27
 * description
 */
public class apps extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        //初始化Zxing二维码库
        ZXingLibrary.initDisplayOpinion(this);

        //部署leakcanary,定位内存泄漏
        if(!LeakCanary.isInAnalyzerProcess(this)){//如果没有部署
            LeakCanary.install(this);//部署
        }

        //初始化跳转
        ARouter.openLog();
        ARouter.openDebug();
        ARouter.init(this);


    }

    //证明不用了就销毁
    @Override
    public void onTerminate() {
        super.onTerminate();
        ARouter.getInstance().destroy();
    }
}
